package com.example.briandang;

import android.app.Activity;
import android.graphics.Point;
import android.os.Bundle;
import android.view.Display;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.TextView;

public class BackgroundImageActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_background_image);
		
		// Get Display Dims
		Display display = getWindowManager().getDefaultDisplay(); 
		Point p = new Point();
		display.getSize(p);
		
		// Get Image View Info
		ImageView iv = (ImageView) this.findViewById(R.id.myCokeBackground);
		int width = iv.getWidth();
		int height = iv.getHeight();
		
		// Get point dims
		width = p.x;
		height = p.y;
		String pointString = p.toString();
		
		// Update display text
		TextView tv = (TextView) this.findViewById(R.id.textView1);
		tv.setText("width: " + width + ", height: " + height + ", pString: " + pointString);
		iv.setScaleType(ScaleType.FIT_XY);
	}
}
